﻿using d1Common.WebController;
using d1Project.Modules.Common.do4A.Domain;
using d1Project.Modules.Common.do4A.Models;
using d1Project.Tools.PagedList;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;

namespace d1Project.Modules.Common.do4A.Controllers.a1
{
    [Route("do4A/a1/AllPermissions")]
    public class AllPermissionsController : Authorize1Controller
    {
        protected override DbContext dbContext
        {
            get
            {
                return this.db;
            }
        }
        private do4ADbContext db = new do4ADbContext();

        public IHttpActionResult Get()
        {
            List<Permission> listAll = PermissionMgr.Instance.AllPermissions;

            return Ok(new { total = listAll.Count(), rows = listAll });
        }
    }

}
